package com.zlz.blog.server.oauth.service.impl;

import com.zlz.blog.manage.common.response.QRCodeResp;
import com.zlz.blog.server.oauth.service.WeChatService;
import com.zlz.blog.server.util.WeChatUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.UUID;

/**
 * @author wb_zhulinzhong
 * @date 2021-06-04 15:29:00
 */
@Service
public class WeChatServiceImpl implements WeChatService {

    @Resource
    private WeChatUtil weChatUtil;

    @Override
    public QRCodeResp getLoginQRCode(HttpServletResponse response) {
        String token = UUID.randomUUID().toString();
        weChatUtil.getQRCode(token);
        return QRCodeResp.builder().token(token).encode("123").build();
    }


}
